﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:c="clr-namespace:OmniKits.Windows.Converters"
                    xmlns:d="clr-namespace:OmniKits.Windows.Design"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <c:BooleanFalseToCollapsedConverter x:Key="FalseToCollapsed"/>
    <c:DoubleMultiplyConveter x:Key="DoubleMultiply"/>
    <c:DoubleMaxConverter x:Key="DoubleMaxConverter"/>
    <c:DoubleToThicknessConverter x:Key="DoubleToThicknessConverter"/>
    
    <!--<FrameworkElement x:Key="ResizeFrameVerticalBorderWidth" DataContext="{DynamicResource {x:Static SystemParameters.ResizeFrameVerticalBorderWidthKey}}"/>-->
    <!--<FrameworkElement x:Key="ResizeFrameHorizontalBorderHeight" DataContext="{DynamicResource {x:Static SystemParameters.ResizeFrameHorizontalBorderHeightKey}}"/>-->
    <!--<FrameworkElement x:Key="ResizeFrameBorderMaxThickness">
        <FrameworkElement.DataContext>
            <MultiBinding Converter="{StaticResource DoubleMaxConverter}">
                <Binding Source="{StaticResource ResizeFrameHorizontalBorderHeight}" Path="DataContext"/>
                <Binding Source="{StaticResource ResizeFrameVerticalBorderWidth}" Path="DataContext"/>
            </MultiBinding>
        </FrameworkElement.DataContext>
    </FrameworkElement>-->
    
    <Style x:Key="ResizeThumbStyle" TargetType="{x:Type d:ResizeThumb}">
        <Setter Property="Width" Value="7"/>
        <Setter Property="Height" Value="7"/>
        <Setter Property="Margin" Value="-3.5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type d:ResizeThumb}">
                    <Rectangle StrokeThickness="1.5" Stroke="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" Fill="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="ResizeBorderStyle" TargetType="{x:Type d:ResizeThumb}">
        <Setter Property="MinWidth" Value="4"/>
        <Setter Property="MinHeight" Value="4"/>
        <Setter Property="Margin" Value="-2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type d:ResizeThumb}">
                    <Rectangle Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="DragMoveCover" TargetType="{x:Type d:DragMoveThumb}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type d:DragMoveThumb}">
                    <Rectangle Fill="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type d:DesignControl}">
        <Setter Property="MinWidth" Value="{Binding Content.MinWidth, RelativeSource={RelativeSource Self}}"/>
        <Setter Property="MinHeight" Value="{Binding Content.MinHeight, RelativeSource={RelativeSource Self}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type d:DesignControl}">
                    <Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                            <ContentPresenter Content="{TemplateBinding Content}"/>
                        </Border>

                        <!-- thumbs -->
                        <d:DesignFrame Visibility="{TemplateBinding IsDesignMode, Converter={StaticResource FalseToCollapsed}}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>